package com.xyoto.takeawayBusiness.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xyoto.takeawayBusiness.constant.OrdersConstant;
import com.xyoto.takeawayBusiness.constant.OrdersStatus;
import com.xyoto.takeawayBusiness.utils.handler.CreateTime;
import com.xyoto.takeawayBusiness.utils.handler.ModifiedTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * orders
 *
 * @author
 */
@Data
@ApiModel("订单表")
public class Orders {

    @ApiModelProperty("订单id")
    private String id;

    @ApiModelProperty("用户id")
    private Integer userId;

    @ApiModelProperty("用户地址id")
    private Integer userAddrId;

    @ApiModelProperty("店铺id")
    private Integer shopId;

    @ApiModelProperty("送达时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date deliveryTime;

    @ApiModelProperty("预计送达时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date estimateTime;

    @ApiModelProperty("配送费（1元=100）")
    private Integer sendPrice;

    @ApiModelProperty("打包费（1元=100）")
    private Integer packPrice;

    @ApiModelProperty("订单总价（1元=100）")
    private Integer totalPrice;

    @ApiModelProperty("商品总数")
    private Integer shoppingTotal;

    @ApiModelProperty("支付金额（1元=100）")
    private Integer payerTotal;

    @ApiModelProperty("总金额（1元=100）")
    private Integer total;

    @ApiModelProperty("订单状态(1:处理中，2：已完成，3：已退款，4：已接单，5：订单异常， 6：未支付，7：已支付)")
    private Short orderStatus;

    @ApiModelProperty("订单类型")
    private Short orderType;

    @ApiModelProperty("备注")
    private String remarks;

    @ApiModelProperty("创建时间")
    @CreateTime
    private Date createTime;

    @ApiModelProperty("修改时间")
    @ModifiedTime
    private Date modifiedTime;

    public Orders(){
//        this.refundStatus = OrdersConstant.ORDER_REFUND_STATUS;
//        this.orderStatus = OrdersStatus.TO_BE_PAID;
    }

}